package org.hdax.easybuyorder.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "easybuy_order", schema = "easybuy", catalog = "")
public class EasybuyOrder {
    private Integer id;
    private Integer userId;
    private String loginName;
    private String userAddress;
    private Timestamp createTime;
    private Double cost;
    private String serialNumber;

    @Id
    @Column(name = "id")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "userId")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "loginName")
    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    @Basic
    @Column(name = "userAddress")
    public String getUserAddress() {
        return userAddress;
    }

    public void setUserAddress(String userAddress) {
        this.userAddress = userAddress;
    }

    @Basic
    @Column(name = "createTime")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "cost")
    public Double getCost() {
        return cost;
    }

    public void setCost(Double cost) {
        this.cost = cost;
    }

    @Basic
    @Column(name = "serialNumber")
    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EasybuyOrder that = (EasybuyOrder) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(loginName, that.loginName) &&
                Objects.equals(userAddress, that.userAddress) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(cost, that.cost) &&
                Objects.equals(serialNumber, that.serialNumber);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, userId, loginName, userAddress, createTime, cost, serialNumber);
    }
}
